#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2020/8/26 14:48
# @Author : way
# @Site :
# @Describe:

from flask import Flask, request, render_template
from data import SourceData
from data_corp import CorpData
from data_job import JobData


app = Flask(__name__)

'''
定义了3个网址，用同一套模板渲染
'''
signal= False


@app.route('/', methods=['POST', 'GET'])
def index():
    # 新建一个实例
    data = SourceData()
    global signal
    if(signal):
        if request.method == 'POST':
            print("post")
            # user = request.form['nm']#获取单个输入框中的内容
            temp_list = request.form  # post方式获取form表单中所有输入框中的数据
        # 传入一个实例，和实例的标题
            return render_template('index0.html',test_data=temp_list['nm'], form=data, title=data.title)
    signal=True
    return render_template('index0.html',test_data="请输入语句", form=data, title=data.title)




if __name__ == "__main__":
    app.run(host='127.0.0.1', debug=False)

